package com.bz.portal.feign;

import com.bz.pojo.TbItem;
import com.bz.pojo.TbItemDesc;
import com.bz.pojo.TbItemParamItem;
import com.bz.portal.feign.fallback.CommonItemFeignClientFallbackFactory;
import com.bz.vo.CatVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 命令规范: 服务名称 + FeignClient
 */
@FeignClient(value = "common-item",fallbackFactory = CommonItemFeignClientFallbackFactory.class)
public interface CommonItemFeignClient {

    //--------------------------- /service/itemCategory --------------------------
    /**
     * 查询首页商品分类
     * @return
     */
    @GetMapping("/service/itemCategory/selectItemCategoryAll")
    CatVo selectItemCategoryAll();

    //--------------------------- /service/item --------------------------
    /**
     * 根据商品ID查询商品
     * @param itemId
     * @return
     */
    @GetMapping("/service/item/selectItemInfo")
    TbItem selectItemInfo(@RequestParam("itemId") Long itemId);

    //--------------------------- /service/itemDesc --------------------------
    /**
     * 根据商品ID查询商品描述
     * @param itemId
     * @return
     */
    @GetMapping("/service/itemDesc/selectItemDescByItemId")
    TbItemDesc selectItemDescByItemId(@RequestParam("itemId")Long itemId);

    //--------------------------- /service/itemParamItem --------------------------

    /**
     *根据商品ID查询商品规格参数
     * @param itemId
     * @return
     */
    @GetMapping("/service/itemParamItem/selectTbItemParamItemByItemId")
    TbItemParamItem selectTbItemParamItemByItemId(@RequestParam("itemId") Long itemId);
}
